package com.phpxiu.app.adapter;

import android.content.Context;
import android.net.Uri;
import android.view.View;
import android.view.ViewGroup;

import com.phpxiu.app.adapter.holder.RoomManagerViewHolder;
import com.phpxiu.app.kkylive.R;
import com.phpxiu.app.model.list.AdminListContent;

import java.util.List;

/**
 * Created by 吴金洲 on 2016/7/8
 */
@Deprecated
public class RoomManagersListAdapter extends BaseSwipeListViewAdapter<AdminListContent> {

    public RoomManagersListAdapter(Context context, List<AdminListContent> data, int mRightWidth, IOnItemRightClickListener mListener) {
        super(context, data, mRightWidth, mListener);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        AdminListContent content=data.get(position);
        RoomManagerViewHolder holder;
        if(convertView==null){
            convertView=mInflater.inflate(R.layout.room_manager_list_item_view,null);
            holder=new RoomManagerViewHolder(convertView);
            convertView.setTag(holder);
        }
        holder=(RoomManagerViewHolder)convertView.getTag();
        holder.leftView.setLayoutParams(leftParam);
        holder.rightView.setLayoutParams(rightParam);
        holder.headView.setImageURI(Uri.parse(content.getAvatar()));
        holder.nickView.setText(content.getNickname());
        if(!"".equals(content.getLvl())){
            holder.lv.setVisibility(View.VISIBLE);
            holder.lv.setImageURI(Uri.parse("asset:///lvIcons/" + content.getLvl() + ".png"));
        }else{
            holder.lv.setVisibility(View.INVISIBLE);
        }
        holder.rightView.setTag(position);
        holder.rightView.setOnClickListener(mListener);
        return convertView;
    }

}
